import PhAlert from './alert.vue'
import PhConfirm from './confirm.vue'
import { createApp } from 'vue'
export default {
    install(app:any){
        const
        adom = document.createElement("div"),
        cdom = document.createElement("div"),
        Alert = createApp(PhAlert),
        Confirm = createApp(PhConfirm),
        ainstance = Alert.mount(adom) as InstanceType<typeof PhAlert>,
        cinstance = Confirm.mount(cdom) as InstanceType<typeof PhConfirm>
        ;
        document.body.appendChild(ainstance.$el)
        document.body.appendChild(cinstance.$el)
        app.config.globalProperties.$phAlert = ainstance.open
        app.config.globalProperties.$phConfirm = cinstance.open
    },
}